﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<brjostagjof.Models.Article>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Greinar
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <a href="/Home/GetArticleByCategoryID/<%: Model.FirstOrDefault().ArticleBase.articleCategoryID %>" class="linksWhite">Tímaröð</a>
    <a href="/Home/Greinar/" class="linksWhite">Til baka í greinar</a>
    <h2>Greinar raðaðar eftir stafrófsröð:</h2>

     <% foreach (var item in Model) 
        { %>
        <div class="entry">
        <div class="entry-bgtop">
        <div class="entry-bgbtm">
            <h2 class="title"><a href="<%: item.ArticleBase.link %><%: item.articleBaseID %>"><%: item.ArticleBase.InformationBase.headline%></a></h2>
            <p class="meta">Höfundur: <a href="../../MySite/ViewUserByID/<%:item.ArticleBase.User.ID  %>"><%: item.ArticleBase.User.name%></a>,  <%: item.ArticleBase.InformationBase.date%> 
	            &nbsp;&bull;&nbsp; 
                <%  int count = brjostagjof.Controllers.HomeController.GetCommentsCountByArticleBaseID(item.articleBaseID); %>
                Umsagnir  (<%: count %>) &nbsp;&bull;&nbsp;
                <a href="/Home/GetArticleByCategoryID/<%: item.ArticleBase.ArticleCategory.ID %>" class="permalink"> <%: item.ArticleBase.ArticleCategory.name %></a>
                &nbsp;&bull;&nbsp; 
                <a href="<%: item.ArticleBase.link %><%: item.ArticleBase.informationBaseID %>" class="permalink">Öll grein</a></p>
      </div>
      </div>
      </div>
      <%} %>

            


</asp:Content>
